﻿/****************************************************************************************************************
*                                                                                                               *
* Copyright (C) 2011 5173.com                                                                                   *
* This project may be copied only under the terms of the Apache License 2.0.                                    *
* Please visit the project Home Page http://bqqapicsharp.codeplex.com/ for more detail.                         *
*                                                                                                               *
****************************************************************************************************************/

namespace BQQAPIClient.Core.Protocol
{
    using BQQAPIClient.Core.Business;
    using BQQAPIClient.Core.Utility;

    internal class AssignKefuPackage : AbstractOperationPackage
    {
        private AssignKefu assignKefu;

        internal AssignKefuPackage(AssignKefu assignKefu)
        {
            this.assignKefu = assignKefu;
        }

        protected override TLVList OtherData
        {
            get
            {
                var tlvList = new TLVList();
                tlvList.Add(new TLV(AssignKefu.TQQID, assignKefu.QQID.GetBigEndianBytes()));
                tlvList.Add(new TLV(AssignKefu.TAssignMode, (byte)assignKefu.AssignMode));
                tlvList.Add(new TLV(AssignKefu.TKefuID, assignKefu.KefuID.GetBigEndianBytes()));
                tlvList.Add(new TLV(AssignKefu.TGroupID, assignKefu.GroupID.GetBigEndianBytes()));
                return tlvList;
            }
        }

        protected override ushort Cmd
        {
            get
            {
                return 24;
            }
        }

        protected override ushort SubCmd
        {
            get
            {
                return 203;
            }
        }
    }
}
